<?php

//押金表
class gift extends spModel
{
	public $pk = "id"; // 数据表的主键
    public $table = "gift"; // 数据表的名称
	
	function getAll($catid = null) {
		$sql = "SELECT g.*, gt.title FROM gift g LEFT JOIN giftcat gt ON g.catid = gt.id";
		if ($catid) {
			$sql .= " WHERE g.catid = $catid";
		}
		$sql .= " ORDER BY value";
		$ret  = $this->findSql($sql);
		return $ret;
	}

}